package whf.framework.lucene.index;

import java.io.IOException;
import java.util.List;

import org.apache.lucene.analysis.Analyzer;

import whf.framework.entity.Entity;
import whf.framework.lucene.IndexConfig;

/**
 * 创建对象的索引
 * 
 * @author wanghaifeng
 * @create Jan 18, 2007 3:40:27 PM
 * 
 */
public class IndexManager extends EntityIndexManager {
	public IndexManager() {
		super(IndexConfig.getAnalyzer(), false);
	}
	public IndexManager(Analyzer analyzer, boolean useRAMDirectory) {
		super(analyzer, useRAMDirectory);
	}
	
	/**
	 * 创建实体索引
	 * @author king
	 * @create 2008-1-23 下午05:58:10
	 * @param entities
	 * @throws IOException
	 */
	public void indexEntieies(List<? extends Entity> entities) throws IOException {
		if(this.useRAMDirectory)
			super.indexEntities(entities);
		else
			super.indexEntitiesDirectly(entities);
	}
}
